package com.bjwl.display.controller;

import com.bjwl.display.service.safty.SysMenuService;
import com.bjwl.display.util.Result;
import com.bjwl.display.vo.SysMenuVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/safty/sys")
public class SysMenuHomeController {
    @Autowired
    private SysMenuService sysMenuService;

    @GetMapping("/list")
    public Result getMenuList(){
        try {
            List<SysMenuVO> list = sysMenuService.metuTree();
            if(list!=null){
                return Result.success("查询成功",list);
            }
            return Result.fail("查询失败");
        } catch (Exception e) {
            e.printStackTrace();
            return Result.fail("系统繁忙");
        }
    }
}
